package com.test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class Main1 {

	public static void testMap() {
		long time = System.currentTimeMillis();
		List<Map<String, Integer>> list = new ArrayList<>();
		for (int i = 0; i < 10; i++) {
			Map<String, Integer> map = new HashMap<>();
			map.put("formId", i);
			map.put("count", i);
			map.put("fresh", i);
			list.add(map);
		}
		list.forEach(e -> {
			Set<Entry<String, Integer>> set = e.entrySet();
			set.forEach(e1 -> {
				System.out.print(e1.getValue());
			});
		});
		System.out.println();
		System.out.println("map time :");
		System.out.print(System.currentTimeMillis() - time);
	}

	public static void testArray() {
		System.out.println("\t");
		long time = System.currentTimeMillis();
		List<int[]> list = new ArrayList<>();
		for (int i = 0; i < 10; i++) {
			int[] array = new int[3];
			array[0] = i;
			array[1] = i;
			array[2] = i;
			list.add(array);
		}
		list.forEach(e -> {
			System.out.print(e[0] + " " + e[1] + " " + e[2]);
		});
		System.out.println();
		System.out.println("array time :");
		System.out.print(System.currentTimeMillis() - time);
	}

	public static void main(String[] args) {
		testArray();
		System.out.println("   ");
		testMap();
	}
}
